LIB=test-monitor
CFLAGS=-g -fPIC -lpthread -L../core -luos-monitor
INCLUDE=-I../libs  -I../include -I./

SRCS_JSON=$(shell find . ./demo_json -maxdepth 1 | grep '\.c$$')
OBJS_JSON=$(SRCS_JSON:%.c=%.o)

SRCS_TEXT=$(shell find . ./demo_text -maxdepth 1 | grep '\.c$$')
OBJS_TEXT=$(SRCS_TEST:%.c=%.o)

all:${LIB}
${LIB}:${OBJS_TEXT} ${OBJS_JSON}
	gcc $(CFLAGS) $(SRCS_JSON) $(INCLUDE) -o $(LIB)_json
	gcc $(CFLAGS) $(SRCS_TEXT) $(INCLUDE) -o $(LIB)_text
%.o:%.c
	gcc -c $^ $(INCLUDE) -o $@ 
clean:
	rm -rf $(LIB)_json $(LIB)_text $(OBJS_JSON) $(OBJS_TEXT)

